package com.bizark.rpc.api.exception;

/**
 * Created by tangshijun on 2017/3/20.
 */
public enum RpcError {
    /**
     * 000000000000 默认错误，一般用于ErrCode进行Stringtoenum转型的用途，不用于程序返回码设置
     */
    DEFAULT_ERR("000000000000", "默认错误"),

    /**
     * 000000000001 系统异常
     */
    SYSTEM_ERR("000000000001", "系统异常"),

    /**
     * 000100000001 传入参数为空
     */
    PUBLIC_PARAMETER_EMPTY("000100000001", "传入参数为空"),

    /**
     * 000100000002 传入参数错误
     */
    PUBLIC_PARAMETER_ERROR("000100000002", "传入参数错误"),

    /**
     * 000100000003 执行更新操作错误
     */
    UPDATE_OPERATOR_ERROR("000100000003", "执行更新操作错误"),

    /**
     * 000100000004 数据已重复
     */
    DATE_ISEXIST_ERROR("000100000004","数据已存在");


    private String errorCode = null;
    private String errorMessage = null;

    private RpcError(String errCode, String errMessage) {
        this.errorCode = errCode;
        this.errorMessage = errMessage;
    }

    public String errMessage() {
        return errorMessage;
    }

    public String errCode() {
        return errorCode;
    }
}
